package net.phoenix.repository.data;

import java.util.ArrayList;
import java.util.List;

import net.phoenix.repository.dao.JdbcDao;

/**
 * 
 * @author lixf
 * 
 */
public class NodeData extends BasicData {
	/**
	 * 
	 */
	private static final long serialVersionUID = -4862917437800697344L;
	private String ID;
	private String parentID;
	private String name;
	private int orderNo = 0;
	private boolean isNew;
	private String primaryType;
	private List<String> mixinTypes;

	public NodeData() {
		this.isNew = true;
		this.ID = Long.toString(JdbcDao.getNextID());
		this.mixinTypes = new ArrayList<String>();
	}
		

	public void setNew(boolean isNew) {
		this.isNew = isNew;
	}

	public boolean isNew() {
		return isNew;
	}

	public void setID(String ID) {
		this.ID = ID;
	}

	public String getID() {
		return ID;
	}

	public void setParentID(String parentID) {
		this.parentID = parentID;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void setOrderNo(int orderNo) {
		this.orderNo = orderNo;
	}

	public String getParentID() {
		return parentID;
	}

	public String getName() {
		return name;
	}

	public int getOrderNo() {
		return orderNo;
	}


	/**
	 * @return the primaryType
	 */
	public String getPrimaryType() {
		return primaryType;
	}

	/**
	 * @param primaryType the primaryType to set
	 */
	public void setPrimaryType(String primaryType) {
		this.primaryType = primaryType;
	}

	
	public boolean equals(Object obj){
		NodeData another = (NodeData)obj;
		return another.ID.equals(ID) && another.name.equals(name);
	}


	/**
	 * @return the mixinTypes
	 */
	public List<String> getMixinTypes() {
		return mixinTypes;
	}

}
